package cn.kgc.service.system;

import cn.kgc.dao.system.jjl_manageDao;
import cn.kgc.pojo.Department;
import cn.kgc.pojo.Jobtitle;
import cn.kgc.pojo.User;
import cn.kgc.pojo.jjl_excal;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class jjl_manageServiceImpl  implements  jjl_manageService{

  @Resource
  private jjl_manageDao md;
    @Override
    public User jjl_queryById(Integer id) {
        return md.queryById(id);
    }


    @Override
    public int jjl_insert(User user) {
        return md.insert(user);
    }

    @Override
    public int jjl_insertBatch(List<User> entities) {
        return md.insertBatch(entities);
    }

    @Override
    public int jjl_insertOrUpdateBatch(List<User> entities) {
        return md.insertOrUpdateBatch(entities);
    }

    @Override
    public boolean jjl_update(User user) {
        if (md.jjl_update(user)>0){
            return  true;
        }return false;
    }

    @Override
    public int jjl_deleteById(Integer id) {
        return md.deleteById(id);
    }

    @Override
    public Page<User> jjl_page(String name, int bumen, int zhiwei) {
        return md.jjl_page(name,bumen,zhiwei);
    }

    @Override
    public List<Jobtitle> jjl_job(Integer id) {
        return md.jjl_job( id);
    }

    @Override
    public List<Department> jjl_dp() {
        return md.jjl_dp();
    }

    @Override
    public boolean updatejob(Integer id, Integer jt_id, Integer state) {
        return md.updatejob(id,jt_id,state);
    }



    @Override
    public List<Jobtitle> jjl_bjob() {
        return md.jjl_bjob();
    }

    @Override
    public List<jjl_excal> jjl_excel() {
        return md.jjl_excel();
    }

    @Override
    public boolean insertdp(String departmentname) {
        return md.insertdp(departmentname);
    }

    @Override
    public boolean insertjob(Integer dp_id, String job) {
        return md.insertjob(dp_id,job);
    }

    @Override
    public boolean deldp(Integer id) {

        try {
            return md.deldp(id);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }



    @Override
    public boolean deljob(Integer id) {
        return md.deljob(id);
    }


}
